#ifndef OLED_H
#define OLED_H

#include "pinctrl.h"
#include "gpio.h"
#include "platform_core_rom.h"
#include "uart.h"
#include "osal_debug.h"
#include "soc_osal.h"
#include "app_init.h"
#include "string.h"
#include "cmsis_os2.h"
#include "../my_device/my_device.h"

enum PAGE{
    START,
    DATA,
    NAVIGATION,
    CONTROL
};
typedef enum {
    CMD_NONE = 0,
    CMD_ID = 1,
    CMD_BEEP = 2,
    CMD_OTHER = 3,  // 新增命令ID
    CMD_CON = 4,
    // 其他命令ID...
} CommandId;

typedef struct {
    uint8_t recv[256];
    uint16_t recv_len;
    CommandId cmd;
    int data;
    int con[2];
    bool valid;
} oled_recv_get;
extern int now_id;
void oled_read_handler(const void *buffer, uint16_t length, bool error);
int oled_write(unsigned char *recv, int length);
void oled_init_config(void);
void oled_gpio_init(void);
void set_oled_data(SensorData* data);
void set_oled_con(ControlState* data);
void oled_init(void);
#endif